<!DOCTYPE html>
<html>

<head>
<meta charset="UTF-8">
<title>ibot manager attachment</title>
<link rel="stylesheet" type="text/css" href="js/easyui-1.3.5/themes/default/easyui.css" />
<link rel="stylesheet" type="text/css" href="js/easyui-1.3.5/themes/icon.css" />
<script src="js/easyui-1.3.5/jquery.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/easyui-1.3.5/jquery.easyui.min.js" type="text/javascript" charset="utf-8"></script>
<script src="js/easyui-1.3.5/jquery.edatagrid.js" type="text/javascript" charset="utf-8"></script>
<script src="js/easyui-1.3.5/ajax.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
var rootName = ajax.getRootName();
var uri=rootName + '/url_manager'
$(function() {
  $('#dg').edatagrid({
    url:uri+'/list',
    saveUrl:uri+'/save',
    destroyUrl:uri+'/destroy',
    updateUrl:uri+'/update',
    onError: function(index, row) {
      alert(row.msg);
    },
    toolbar:[
      {text:"add",iconCls:"icon-add",handler:function(){
        $('#dg').edatagrid('addRow');
      }},
      {text:'remove',iconCls:"icon-remove",handler:function(){
        $('#dg').edatagrid('destroyRow');
        
      }},
      {text:"save",iconCls:'icon-save',handler:function(){
        $('#dg').edatagrid('saveRow');
      }},
      {text:'undo',iconCls:'icon-undo',handler:function(){
        $('#dg').edatagrid('cancelRow');
      }},
      {text:'导出',handler:function(){
        alert("导出开发中");
      }},
      {text:'导入',handler:function(){
        alert("导入开发中")
      }}
    ],
  });
});
</script>
</head>

<body>
<table id='dg' title='配置外链地址', singleSelect='true' rownumbers='true' idField='id' pagination='true'>
  <thead>
    <tr>
      <th field="id" editor={type:'validatebox',options:{required:true}}>id</th>
      <th field="url" editor={type:'validatebox',options:{required:true}}>url</th>
    </tr>
  </thead>
</table>
</body>
</html>